package word;

import Common.Game;

import javax.swing.*;
import java.awt.*;

public class word implements Game {
    public static void main(String[] args) {
        JFrame frame = new JFrame("打字游戏");
        WordPanel panel = new WordPanel();
        frame.add(panel);
        Thread t = new Thread(panel);
        t.start();
        panel.addKeyListener(panel);
        panel.setFocusable(true);
        frame.setSize(800, 600);
        frame.setLocationRelativeTo((Component)null);
        frame.setDefaultCloseOperation(3);
        frame.setVisible(true);
    }

    @Override
    public void run() {
        JFrame frame = new JFrame("打字游戏");
        WordPanel panel = new WordPanel();
        frame.add(panel);
        Thread t = new Thread(panel);
        t.start();
        panel.addKeyListener(panel);
        panel.setFocusable(true);
        frame.setSize(800, 600);
        frame.setLocationRelativeTo((Component)null);
        frame.setDefaultCloseOperation(3);
        frame.setVisible(true);

    }
}
